package com.qd.panda.service.third.tencent.result;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.experimental.Accessors;

@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ToString
public class GeoCoderResult extends BaseResult {
    private Result result;

    @Data
    @ToString
    public static class Result {
        @JsonProperty("ad_info")
        private AdInfo adInfo;

        public void freeData() {
            this.adInfo.freeData();
        }

        @Data
        @ToString
        public static class AdInfo {
            @JsonProperty("adcode")
            private String adCode;

            public void freeData() {
                this.adCode = null;
            }
        }
    }

    @Override
    public void freeData() {
        this.result.freeData();
        super.freeData();
    }
}

